<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="boy">差评</div>
    <div class="boy">好评</div>
    <ul>
        <li>首页</li>
        <li>末尾</li>
    </ul>
    <script>
        //   getElementsByClassName('类名'); 通过类名获取某些元素的集合
        var boy = document.getElementsByClassName('boy');
        console.log(boy);
    </script>
</body>
</html>